<template>
  <layout-slot :reArticle="reArticle">
    <article class="main-content page-page">
      <div class="post-header">
        <h1 class="post-title" itemprop="name headline">
          影视 </h1>
        <div class="post-data">

          <time datetime="2020-08-22T23:56:00+08:00" itemprop="datePublished">
            <i class="fa fa-clock-o" aria-hidden="true"> </i>
            {{ moviesDetail.articleUpdated |  dateFormat('{y}-{m}-{d}')  }}
          </time>&nbsp;&nbsp; <i class="fa fa-comments-o" aria-hidden="true"></i> <a href="#comments"> {{ comments }} 评论</a>&nbsp;&nbsp;
          <i class="fa fa-eye" aria-hidden="true"></i> {{ moviesDetail.articleViewCount }} 浏览
        </div>
      </div>
      <div id="post-content" class="post-content" v-html="moviesDetail.articleContent">
        <!--        <div data-status="watched" class="douban-movie-list doubanboard-list"></div>-->
        <!--        <div class="douban-loadmore" id="loadMoreMovies_watched" onclick="DoubanBoard.loadMovies('watched');">加载中...-->
        <!--        </div>-->
<!--        <div v-for="item of moviesList">-->
<!--          <p>{{ item.type }}</p>-->
<!--          <blockquote>-->
<!--            <p>{{ item.detail }}</p>-->
<!--          </blockquote>-->
<!--        </div>-->

<!--        <h1>Video赏析</h1>-->
<!--        <p><a href="https://www.bilibili.com/movie/" target="_blank">https://www.bilibili.com/movie/</a></p>-->
<!--        <h1>在线影视网址推荐</h1>-->
<!--        <p>-->
<!--          <a href="https://v.qq.com/" target="_blank">https://v.qq.com/</a><br>-->
<!--          <a href="https://www.iqiyi.com/" target="_blank">https://www.iqiyi.com/</a>-->
<!--        </p>-->



      </div>
    </article>
    <Twikoo/>
  </layout-slot>
</template>

<script>

  import { getMoviesDetail, getReArticle, recordCount } from '~/api'

  export default {
    name: "movies",
    data() {
      return {
        moviesDetail: {},
        reArticle:[]
      }
    },

    computed:{
      comments () {
        return this.$store.state.comments
      }
    },
    methods: {
      getMoviesPage() {


      }
    },
    mounted() {
      this.getMoviesPage()
    },
    async asyncData({app,}){
      let moviesDetail = {}
      await getMoviesDetail(app.$axios,{path: "/movies"}).then(({data}) => {
        moviesDetail = data.data
        // 记录浏览量
        recordCount(app.$axios,{id: data.data.oId}).then((res) => {
        })

      })
      let reArticle = await getReArticle(app)
      return { moviesDetail,reArticle}
    }
  }
</script>

<style scoped>

</style>
